import csv
import logging
from logging import config

from faker import Faker

like_host = "http://192.168.8.19:8081"

faker = Faker(locale="zh_CN")
# 加载日志配置文件
config.fileConfig("resources/config/log.conf")
# 获取日志输出对象
logger = logging.getLogger()

logger.debug("调试级别的日志")
logger.info("这是一行信息级别日志")
logger.warning("这是一行警告级别日志")
logger.error("错误级别的日志")

def getCsvData(path):
    # 获取csv文件对象
    with open(path,mode='r',encoding='utf-8') as cases:
        # 读取csv文件
        csvReader = csv.reader(cases)
        #定义用例列表
        caseList = []
        # 遍历数据
        for index, row in enumerate(csvReader, 1):
            if index > 1:
                caseList.append(row)
    return caseList